import request from '@/utils/request'

// 查询训练想定列表
export function listPropose(query) {
  return request({
    url: '/uav/propose/list',
    method: 'get',
    params: query
  })
}

// 查询训练想定详细
export function getPropose(trainingProposeId) {
  return request({
    url: '/uav/propose/' + trainingProposeId,
    method: 'get'
  })
}

// 新增训练想定
export function addPropose(data) {
  return request({
    url: '/uav/propose',
    method: 'post',
    data: data
  })
}

// 修改训练想定
export function updatePropose(data) {
  return request({
    url: '/uav/propose',
    method: 'put',
    data: data
  })
}

// 删除训练想定
export function delPropose(trainingProposeId) {
  return request({
    url: '/uav/propose/' + trainingProposeId,
    method: 'delete'
  })
}

// 导出训练想定
export function exportPropose(query) {
  return request({
    url: '/uav/propose/export',
    method: 'get',
    params: query
  })
}

// 获取地物列表
export function getObstacleList(id) {
  return request({
    url: `/uav/obstacle/${id}`,
    method: 'get'
  })
}

// 更新地物列表
export function updateObstacle(data) {
  return request({
    url: '/uav/obstacle',
    method: 'post',
    data
  })
}

export function addTaskRecord(data) {
  return request({
    url: '/uav/record',
    method: 'post',
    data
  })
}

/**
 * 功能描述： 执行终端脚本
 * @param data
 * @returns {*}
 */
export function startBat(data) {
  return request({
    url: '/uav/bat/execBat',
    method: 'post',
    data: data
  })
}

